package com.example.Windturbine.Utils;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @Author 丁永新
 * @Date 2021/12/13
 */
@Component
public class MyVerfication {
    public boolean isLegleName(String name){
        return (name.length()>=1)&&(name.length()<=15);
    }
    public boolean isLegleUsername(String name){
        return (name.length()>=2)&&(name.length()<=15);
    }
    public boolean isLeglePhone(String phone){
        if(phone.length()!=11) return false;
        char[] nums=phone.toCharArray();
        for(char c:nums){
            if((c-'0')<0||(c-'0')>9) return false;
        }
        return true;
    }
    public boolean isLegleEmail(String email){
        if(email.length()>35) return false;
        return true;
    }

}
